package org.example.elastic.lite.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 动态定时任务配置
 * @author 魏荣杰
 * @date 2022/11/11 09:54
 * @since
 * @version
 */
@Configuration
public class DynamicElasticJobConfig {

//    @Value("${elasticjob.reg-center.server-lists}")
//    private String serverLists;
//    @Value("${elasticjob.reg-center.namespace}")
//    private String namespace;
//
//    @Bean
//    public ZookeeperConfiguration zookeeperConfiguration() {
//        return new ZookeeperConfiguration(serverLists, namespace);
//    }
//
//    @Bean(initMethod = "init")
//    public ZookeeperRegistryCenter zookeeperRegistryCenter(ZookeeperConfiguration zookeeperConfiguration) {
//        return new ZookeeperRegistryCenter(zookeeperConfiguration);
//    }

    @Bean
    public DynamicElasticJobListener elasticJobListener() {
        return new DynamicElasticJobListener(100, 100);
//        return new DynamicElasticJobListener();
    }
}
